<template>
  <div class="dashboard-container">
    <div class="dashboard-text">visualData:{{ visualData }}</div>
    <el-button @click.native.prevent="VisualGetInfo">服务指标</el-button>
    <div>data:{{ data[0].fault[0].index[3] }}</div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'VisualGetInfo',
  data() {
    // const finalData = {
    //   "申告": Number,
    //   "处理": Number,
    //   "回单": Number,
    //   "成功": Number,
    // }
    // const d1 =
    // const f1 = {"网络无法连接": d1}
    // const cq = {f1,f2,f3}
    // const are = {cq, yn, gd}
    // are.cq.f1= {"网络无法连接":{"申告":123,"处理":122,"回单":102,"成功":100}}
    // are.cq.f1= {"拨号异常":{"申告":333,"处理":321,"回单":312,"成功":301}}
    return { data: [{ province: '重庆',
      fault: [{ faultName: '网络无法连接',
        index: [{ name: '申告量', data: 123 }, { name: '处理量', data: 109 }, { name: '回单量', data: 100 }, { name: '成功量', data: 99 }] },
      { faultName: '拨号异常',
        index: [{ name: '申告量', data: 534 }, { name: '处理量', data: 511 }, { name: '回单量', data: 510 }, { name: '成功量', data: 599 }] },
      { faultName: '其他故障',
        index: [{ name: '申告量', data: 2134 }, { name: '处理量', data: 2111 }, { name: '回单量', data: 2110 }, { name: '成功量', data: 1199 }] }] },
    { province: '云南',
      fault: [{ faultName: '网络无法连接',
        index: [{ name: '申告量', data: 523 }, { name: '处理量', data: 509 }, { name: '回单量', data: 500 }, { name: '成功量', data: 499 }] },
      { faultName: '拨号异常',
        index: [{ name: '申告量', data: 2934 }, { name: '处理量', data: 2911 }, { name: '回单量', data: 2910 }, { name: '成功量', data: 2899 }] },
      { faultName: '其他故障',
        index: [{ name: '申告量', data: 334 }, { name: '处理量', data: 311 }, { name: '回单量', data: 310 }, { name: '成功量', data: 299 }] }] },
    { province: '广东',
      fault: [{ faultName: '网络无法连接',
        index: [{ name: '申告量', data: 823 }, { name: '处理量', data: 809 }, { name: '回单量', data: 800 }, { name: '成功量', data: 799 }] },
      { faultName: '拨号异常',
        index: [{ name: '申告量', data: 234 }, { name: '处理量', data: 211 }, { name: '回单量', data: 210 }, { name: '成功量', data: 199 }] },
      { faultName: '其他故障',
        index: [{ name: '申告量', data: 934 }, { name: '处理量', data: 911 }, { name: '回单量', data: 910 }, { name: '成功量', data: 899 }] }] }] }
  },
  computed: {
    ...mapGetters([
      'visualData'
    ])
  },

  methods: {

    VisualGetInfo() {
      this.$store.dispatch('VisualGetInfo').then(() => {
        console.log('over')
      })
    }
  }
}

</script>

